import request from "@/utils/request";
// 分类列表
export function showAllCategory(query) {
  return request({
    url: "/commodity/category/showAllCategory",
    method: "get",
    params: query,
  });
}
//是否在用户端展示
export function changeShowUserHome(data) {
  return request({
    url: "/commodity/category/isShowUserHome",
    method: "put",
    data,
  });
}
//是否在pc端展示
export function changeShowPcHome(data) {
  return request({
    url: "/commodity/category/isShowPcHome",
    method: "put",
    data,
  });
}
//提交是否推荐

export function changeShowRecommend(data) {
  return request({
    url: "/commodity/category/isShowRecommend",
    method: "put",
    data,
  });
}
//排序
export function changeSort(data) {
  return request({
    url: "/commodity/category/changeSort",
    method: "put",
    data,
  });
}
//是否pc首页菜单
export function changeIndexPcMenu(data) {
  return request({
    url: "/commodity/category/isIndexPcMenu",
    method: "put",
    data,
  });
}
//查询编辑分类
export function getMallProductCategory(id) {
  return request({
    url: "/commodity/category/getMallProductCategory/" + id,
    method: "get",
  });
}
//提交编辑结果
export function updateMallProductCategory(data) {
  return request({
    url: "/commodity/category/updateMallProductCategory",
    method: "put",
    data,
  });
}
// 本地分类列表
export function showTreeProductCate(query) {
  return request({
    url: "/commodity/category/showTreeProductCate",
    method: "get",
    params: query,
  });
}
// 提交拉取本地分类的列表
export function addAllProductCate(data) {
  return request({
    url: "/commodity/category/addAllProductCate",
    method: "post",
    data,
  });
}
//是否再小程序分类菜单展示
export function changeMiniProgram(data) {
  return request({
    url: "/commodity/category/isShowPcHome",
    method: "put",
    data,
  });
}
